home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / telecomm / bbs / tbbs093.lha / Rexx / USet.rexx < prev    next >
OS/2 REXX Batch file  |  1994-02-15  |  5KB  |  134 lines

  1. /* User settings script */
  2.  
  3. CR = D2C(13)
  4. LF = D2C(10)
  5. CRLF = CR||LF
  6. ESC = D2C(27)
  7. WHITE = ESC||"[0m"
  8. RED = ESC||"[31m"
  9. GREEN = ESC||"[32m"
  10. YELLOW = ESC||"[33m"
  11. BLUE = ESC||"[34m"
  12. PURPLE = ESC||"[35m"
  13. CYAN = ESC||"[36m"
  14. CLEAR = D2C(12)
  15. ln = arg(1)
  16. LineName = Con_LineActive(ln)
  17. if LineName = "" then exit 10
  18. address value LineName
  19. do forever
  20.     SetStatus "User Settings:"
  21.     SendModem CRLF||"(1)           "||CYAN||"Name: "||WHITE||GetUserName(ln)||CRLF
  22.     SendModem "(2) "||CYAN||"Street address: "||WHITE||GetUserMisc(ln, "ADDRESS")||CRLF
  23.     SendModem "(3)           "||CYAN||"City: "||WHITE||GetUserMisc(ln, "CITY")||CRLF
  24.     SendModem "(4)    "||CYAN||"Postal code: "||WHITE||GetUserMisc(ln, "POSTCODE")||CRLF
  25.     SendModem "(5)        "||CYAN||"Country: "||WHITE||GetUserMisc(ln, "COUNTRY")||CRLF
  26.     SendModem "(6)   "||CYAN||"Voice number: "||WHITE||GetUserMisc(ln, "VPHONE")||CRLF
  27.     SendModem "(7)    "||CYAN||"Data number: "||WHITE||GetUserMisc(ln, "DPHONE")||CRLF
  28.     SendModem "(8)       "||CYAN||"Password: "||WHITE||Left("", Length(GetPassword(ln)), "-")||CRLF
  29.     SendModem CRLF||"(Q) "||CYAN||"Quit"||WHITE||CRLF||CRLF
  30.     cmdstr = AskInput(ln, "("||GetTimeLeft(ln)||") "||CYAN||"User Settings: "||WHITE, "", 255)
  31.     sendmodem CRLF
  32.     do while (left(cmdstr, 1) = " ") & (length(cmdstr) > 0)
  33.         cmdstr = right(cmdstr, length(cmdstr) - 1)
  34.         end
  35.     parse var cmdstr cmdid cmdstr
  36.     cmdid = upper(cmdid)
  37.     do while (left(cmdstr, 1) = " ") & (length(cmdstr) > 0)
  38.         cmdstr = right(cmdstr, length(cmdstr) - 1)
  39.         end
  40.     select
  41.         when cmdid = "1" then do
  42.             SendModem CRLF||"Ask the SysOp if you want your name changed"||CRLF||CRLF
  43. /*
  44.             if Length(CmdStr) > 0 then do
  45.                 do while Left(CmdStr, 1) = " "
  46.                     CmdStr = Right(CmdStr, Length(CmdStr) - 1)
  47.                     end
  48.                 if CmdStr ~= "" then SetUserName GetArgs()
  49.                 end
  50.             else SetUserName AskInput(ln, "Enter your full name: ", GetUserName(ln), 36, "CAPITAL")
  51. */
  52.             end
  53.         when cmdid = "2" then do
  54.             SendModem CRLF
  55.             if Length(CmdStr) > 0 then do
  56.                 do while Left(CmdStr, 1) = " "
  57.                     CmdStr = Right(CmdStr, Length(CmdStr) - 1)
  58.                     end
  59.                 if CmdStr ~= "" then call SetUserMisc ln, "ADDRESS", GetArgs()
  60.                 end
  61.             else call SetUserMisc ln, "ADDRESS", AskInput(ln, "Street address: ", GetUserMisc(ln, "ADDRESS"), 80)
  62.             end
  63.         when cmdid = "3" then do
  64.             SendModem CRLF
  65.             if Length(CmdStr) > 0 then do
  66.                 do while Left(CmdStr, 1) = " "
  67.                     CmdStr = Right(CmdStr, Length(CmdStr) - 1)
  68.                     end
  69.                 if CmdStr ~= "" then call SetUserMisc ln, "CITY", GetArgs()
  70.                 end
  71.             else call SetUserMisc ln, "CITY", AskInput(ln, "City: ", GetUserMisc(ln, "CITY"), 40)
  72.             end
  73.         when cmdid = "4" then do
  74.             SendModem CRLF
  75.             if Length(CmdStr) > 0 then do
  76.                 do while Left(CmdStr, 1) = " "
  77.                     CmdStr = Right(CmdStr, Length(CmdStr) - 1)
  78.                     end
  79.                 if CmdStr ~= "" then call SetUserMisc ln, "POSTCODE", GetArgs
  80.                 end
  81.             else call SetUserMisc ln, "POSTCODE", AskInput(ln, "Postal code: ", GetUserMisc(ln, "POSTCODE"), 40)
  82.             end
  83.         when cmdid = "5" then do
  84.             SendModem CRLF
  85.             if Length(CmdStr) > 0 then do
  86.                 do while Left(CmdStr, 1) = " "
  87.                     CmdStr = Right(CmdStr, Length(CmdStr) - 1)
  88.                     end
  89.                 if CmdStr ~= "" then call SetUserMisc ln, "COUNTRY", GetArgs()
  90.                 end
  91.             else call SetUserMisc ln, "COUNTRY", AskInput(ln, "Country: ", GetUserMisc(ln, "COUNTRY"), 40)
  92.             end
  93.         when cmdid = "6" then do
  94.             SendModem CRLF
  95.             if Length(CmdStr) > 0 then do
  96.                 do while Left(CmdStr, 1) = " "
  97.                     CmdStr = Right(CmdStr, Length(CmdStr) - 1)
  98.                     end
  99.                 if CmdStr ~= "" then call SetUserMisc ln, "VPHONE", GetArgs()
  100.                 end
  101.             else call SetUserMisc ln, "VPHONE", AskInput(ln, "Voice number: ", GetUserMisc(ln, "VPHONE"), 40)
  102.             end
  103.         when cmdid = "7" then do
  104.             SendModem CRLF
  105.             if Length(CmdStr) > 0 then do
  106.                 do while Left(CmdStr, 1) = " "
  107.                     CmdStr = Right(CmdStr, Length(CmdStr) - 1)
  108.                     end
  109.                 if CmdStr ~= "" then call SetUserMisc ln, "DPHONE", GetArgs()
  110.                 end
  111.             else call SetUserMisc ln, "DPHONE" , AskInput(ln, "Data number: ", GetUserMisc(ln, "DPHONE"), 40)
  112.             end
  113.         when cmdid = "8" then do
  114.             SendModem CRLF
  115.             Password = AskInput(ln, "Enter your old password: ", "", 16, "SECURE")
  116.             SendModem CRLF
  117.             if CheckPassword(ln, Password) then do
  118.                 Password = ""
  119.                 do while Password = ""
  120.                     Password = AskInput(ln, "Enter a new password: ", "", 16, "SECURE")
  121.                     SendModem CRLF
  122.                     Pwv = AskInput(ln, "Enter again for verification: ", "", 16, "SECURE")
  123.                     SendModem CRLF
  124.                     if Password ~= Pwv then Password = ""
  125.                     end
  126.                 SetPassword Password
  127.                 end
  128.             else SendModem "Invalid password"||CRLF
  129.             end
  130.         when cmdid = "Q" then exit 0
  131.         otherwise
  132.         end
  133.     end
  134.